package erfgame.core.world.terrain.factory.j3d;

import java.awt.Dimension;
import java.awt.Frame;

import javax.media.j3d.Canvas3D;

import org.junit.Test;

import com.sun.j3d.utils.universe.SimpleUniverse;

import erfgame.core.Dimensions3D;
import erfgame.core.Rotation;
import erfgame.core.j3d.ColorCubeBranchGroupFactory;
import erfgame.core.word.Adjective;
import erfgame.core.word.Noun;
import erfgame.core.world.terrain.MaterialType;
import erfgame.core.world.terrain.TerrainUpdate;
import erfgame.core.world.terrain.TerrainUpdateGroup;
import erfgame.core.world.terrain.factory.j3d.Shape3DTerrainUpdateByMaterialTypeBoundsAndRotationFactory;

public class Shape3DTerrainUpdateByMaterialTypeBoundsAndRotationFactoryTester {

	@Test
	public void testCube() {
		

		Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration(), false);
		canvas.setSize( new Dimension(100, 100) );

		Frame frame;
		frame = new Frame();
		frame.add(canvas);
		frame.pack();
		frame.setVisible(true);

		// create the factory
		Shape3DTerrainUpdateByMaterialTypeBoundsAndRotationFactory factory;
		factory = new Shape3DTerrainUpdateByMaterialTypeBoundsAndRotationFactory(new ColorCubeBranchGroupFactory(0.4), (short)0, canvas);
		

		TerrainUpdateGroup update = factory.createTerrainUpdate((byte)1, new Dimensions3D( 10, 10, 10 ), Rotation.degrees0);
		
		try { 
			Thread.sleep( 3000 );
		} catch ( InterruptedException ex ) {
			
		}
		frame.dispose();
		


	}
}
